package br.com.eduquiz.session;

import br.com.eduquiz.entity.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("auditoriaList")
public class AuditoriaList extends EntityQuery<Auditoria> {
	
	private static final long serialVersionUID = 7591159205478215416L;

	private static final String EJBQL = "select auditoria from Auditoria auditoria";

	private static final String[] RESTRICTIONS = {
			"lower(auditoria.clientIP) like lower(concat(#{auditoriaList.auditoria.clientIP},'%'))",
			"lower(auditoria.descricao) like lower(concat(#{auditoriaList.auditoria.descricao},'%'))", };

	private Auditoria auditoria = new Auditoria();

	public AuditoriaList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Auditoria getAuditoria() {
		return auditoria;
	}
}
